package cz.hanis.android.geography.comparator;

import java.util.Comparator;

import cz.hanis.android.geography.models.Country;

public class ByPopulationComparator implements Comparator<Country> {

	@Override
	public int compare(Country country1, Country country2) {
		if(country1.getPopulation() == country2.getPopulation()) {
			return 0;
		} else if(country1.getPopulation() < country2.getPopulation()) {
			return 1;
		} else {
			return -1;
		}
	}
	
}
